<?php

namespace App\Http\Controllers;

use App\Models\TranslateRecord;
use Illuminate\Http\Request;

use App\Http\Requests;

class AdminTranslateRecordController extends Controller
{
    public function index(Request $request)
    {
        $query = TranslateRecord::query()
            ->with('translateSection:translate_sections_title')
            ->orderBy('id', 'desc');

        if (!empty($request->status))
        {
            $query->where('status', $request->status);
        }
        $records = $query->paginate();
        return view('translate.index', compact('records'));
    }
}
